<?php
function sendmail($to = 'phuc@uniweb.vn', $arr = array()){

	// subject
	$subject = 'CONFIRMATION COURRIEL';
	$message = file_get_contents('CONFIRMATION_COURRIEL.html');
	
	foreach($arr as $k => $ele){
		$message = str_replace("{{". $k ."}}", $ele, $message);
	}

	// To send HTML mail, the Content-type header must be set
	$headers  = 'MIME-Version: 1.0' . "\r\n";
	$headers .= 'Content-type: text/html; charset=utf-8' . "\r\n";

	// Additional headers
	/*
	$headers .= 'To: Mary <mary@example.com>, Kelly <kelly@example.com>' . "\r\n";
	$headers .= 'From: Birthday Reminder <birthday@example.com>' . "\r\n";
	$headers .= 'Cc: birthdayarchive@example.com' . "\r\n";
	$headers .= 'Bcc: birthdaycheck@example.com' . "\r\n";
	*/
	
	$headers .= 'From: CONFIRMATION COURRIEL <info@example.com>' . "\r\n";
	
	// Mail it
	mail($to.',thao@uniweb.vn', $subject, $message, $headers);

}
/*
$arr = array(
	"date"=> "Jeudi le 17 octobre 2013 (16h30)",
	"invoice" => "12343-10000",
	"order" => "1 x Trousse d'eau classique @ 15,25 \$ch = 15,25 $ <br/>
				2 x Trousse d'eau classique @ 15,25 \$ch = 30,50 $
				",
	"order_total" => "15,25 $",
	"shipping" => "19,85 $",
	"insurance" => "5,58 $",
	"fuel" => "1,00 $",
	"subtotal" => "456,70 $",
	"TPS" => "22,84 $",
	"TVQ" => "45,56 $",
	"total" => "525,10 $",
	"payment" => "VISA",
	"reference-number" => "660109490013460530",
	"billing_address" => "derek fong <br/>
							5141 Casgrain <br/>
							Montreal, QC <br/>
							H2T1W8",
	"delivery_address" => "derek fong <br/>
							5141 Casgrain <br/>
							Montreal, QC <br/>
							H2T1W8",
	"phone" => "5145551212",
	
							
);
sendmail('phuc@uniweb.vn', $arr);
*/
?>